import { Rule } from "./types";

export const NamingRuleList: Rule[] = [
    {
        id: "BooleanPropertyNaming",
        descEn: "Reports when a boolean property doesn't match a pattern",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "allowedPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "^(is|has|are)",
            },
            {
                param: "ignoreOverridden",
                descEn: "ignores properties that have the override modifier",
                descCn: "",
                defaultValue: true,
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#booleanpropertynaming",
    },
    {
        id: "ClassNaming",
        descEn: "Reports class or object names that do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "classPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[A-Z][a-zA-Z0-9]*",
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#classnaming",
    },
    {
        id: "ConstructorParameterNaming",
        descEn: "Reports constructor parameter names that do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "parameterPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[a-z][A-Za-z0-9]*",
            },
            {
                param: "privateParameterPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[a-z][A-Za-z0-9]*",
            },
            {
                param: "excludeClassPattern",
                descEn: "ignores variables in classes which match this regex",
                descCn: "",
                defaultValue: "$^",
            },
            {
                param: "ignoreOverridden",
                descEn: "ignores constructor properties that have the override modifier",
                descCn: "",
                defaultValue: true,
            },
        ],
        url: "https://detekt.dev/docs/rules/naming#constructorparameternaming",
    },
    {
        id: "EnumNaming",
        descEn: "Reports enum names that do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "enumEntryPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[A-Z][_a-zA-Z0-9]*",
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#enumnaming",
    },
    {
        id: "ForbiddenClassName",
        descEn: "Reports class names which are forbidden per configuration. By default, this rule does not report any classes. Examples for forbidden names might be too generic class names like ...Manager.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "forbiddenName",
                descEn: "forbidden class names",
                descCn: "",
                defaultValue: [],
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#forbiddenclassname",
    },
    {
        id: "FunctionMaxLength",
        descEn: "Reports when very long function names are used.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "maximumFunctionNameLength",
                descEn: "maximum name length",
                descCn: "",
                defaultValue: 30,
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#functionmaxlength",
    },
    {
        id: "FunctionMinLength",
        descEn: "Reports when very short function names are used.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "minimumFunctionNameLength",
                descEn: "minimum name length",
                descCn: "",
                defaultValue: 3,
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#functionminlength",
    },
    {
        id: "FunctionNaming",
        descEn: "Reports function names that do not follow the specified naming convention. One exception are factory functions used to create instances of classes. These factory functions can have the same name as the class being created.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "functionPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[a-z][a-zA-Z0-9]*",
            },
            {
                param: "excludeClassPattern",
                descEn: "ignores functions in classes which match this regex",
                descCn: "",
                defaultValue: "$^",
            },
            {
                param: "ignoreOverridden",
                descEn: "ignores functions that have the override modifier",
                descCn: "",
                defaultValue: true,
            },
        ],
        url: "https://detekt.dev/docs/rules/naming#functionnaming",
    },
    {
        id: "FunctionParameterNaming",
        descEn: "Reports function parameter names that do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "parameterPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[a-z][a-zA-Z0-9]*",
            },
            {
                param: "excludeClassPattern",
                descEn: "ignores variables in classes which match this regex",
                descCn: "",
                defaultValue: "$^",
            },
            {
                param: "ignoreOverridden",
                descEn: "ignores overridden functions with parameters not matching the pattern",
                descCn: "",
                defaultValue: true,
            },
        ],
        url: "https://detekt.dev/docs/rules/naming#functionparameternaming",
    },
    {
        id: "InvalidPackageDeclaration",
        descEn: "Reports when the file location does not match the declared package.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "rootPackage",
                descEn: "if specified this part of the package structure is ignored",
                descCn: "",
                defaultValue: '',
            },
            {
                param: "requireRootInDeclaration",
                descEn: "requires the declaration to start with the specified rootPackage",
                descCn: "",
                defaultValue: false,
            },
        ],
        url: "https://detekt.dev/docs/rules/naming#invalidpackagedeclaration",
    },
    {
        id: "LambdaParameterNaming",
        descEn: "Reports lambda parameter names that do not follow the specified naming convention.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "parameterPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[a-z][A-Za-z0-9]*|_"
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#lambdaparameternaming",
    },
    {
        id: "MatchingDeclarationName",
        descEn: `"If a Kotlin file contains a single non-private class (potentially with related top-level declarations), its name should be the same as the name of the class, with the .kt extension appended. If a file contains multiple classes, or only top-level declarations, choose a name describing what the file contains, and name the file accordingly. Use camel humps with an uppercase first letter (e.g. ProcessDeclarations.kt).

        The name of the file should describe what the code in the file does. Therefore, you should avoid using meaningless words such as "Util" in file names." - Official Kotlin Style Guide`,
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "mustBeFirst",
                descEn: "name should only be checked if the file starts with a class or object",
                descCn: "",
                defaultValue: true,
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#matchingdeclarationname",
    },
    {
        id: "MemberNameEqualsClassName",
        descEn: "This rule reports a member that has the same as the containing class or object. This might result in confusion. The member should either be renamed or changed to a constructor. Factory functions that create an instance of the class are exempt from this rule.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "ignoreOverridden",
                descEn: "if overridden functions and properties should be ignored",
                descCn: "",
                defaultValue: true,
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#membernameequalsclassname",
    },
    {
        id: "NoNameShadowing",
        descEn: "Disallows shadowing variable declarations. Shadowing makes it impossible to access a variable with the same name in the scope.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [],
        url: "https://detekt.dev/docs/rules/naming#nonameshadowing",
    },
    {
        id: "NonBooleanPropertyPrefixedWithIs",
        descEn: "Reports when property with 'is' prefix doesn't have a boolean type.",
        descCn: "",
        active: false,
        debt: "",
        paramList: [],
        url: "https://detekt.dev/docs/rules/naming#nonbooleanpropertyprefixedwithis",
    },
    {
        id: "ObjectPropertyNaming",
        descEn: "Reports property names inside objects that do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "constantPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[A-Za-z][_A-Za-z0-9]*",
            },
            {
                param: "propertyPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[A-Za-z][_A-Za-z0-9]*",
            },
            {
                param: "privatePropertyPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "(_)?[A-Za-z][_A-Za-z0-9]*",
            },
        ],
        url: "https://detekt.dev/docs/rules/naming#objectpropertynaming",
    },
    {
        id: "PackageNaming",
        descEn: "Reports package names that do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[a-z]+(\\.[a-z][A-Za-z0-9]*)*",
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#packagenaming",
    },
    {
        id: "TopLevelPropertyNaming",
        descEn: "Reports top level constant that which do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "",
        paramList: [
            {
                param: "constantPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[A-Z][_A-Z0-9]*",
            },
            {
                param: "propertyPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[A-Za-z][_A-Za-z0-9]*",
            },
            {
                param: "privatePropertyPattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "_?[A-Za-z][_A-Za-z0-9]*",
            },
        ],
        url: "https://detekt.dev/docs/rules/naming#toplevelpropertynaming",
    },
    {
        id: "VariableMaxLength",
        descEn: "maximum name length",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "maximumVariableNameLength",
                descEn: "",
                descCn: "",
                defaultValue: 64,
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#variablemaxlength",
    },
    {
        id: "VariableMinLength",
        descEn: "Reports when very short variable names are used.",
        descCn: "",
        active: false,
        debt: "5min",
        paramList: [
            {
                param: "minimumVariableNameLength",
                descEn: "minimum name length",
                descCn: "",
                defaultValue: 1,
            }
        ],
        url: "https://detekt.dev/docs/rules/naming#variableminlength",
    },
    {
        id: "VariableNaming",
        descEn: "Reports variable names that do not follow the specified naming convention.",
        descCn: "",
        active: true,
        debt: "5min",
        paramList: [
            {
                param: "variablePattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "[a-z][A-Za-z0-9]*",
            },
            {
                param: "privateVariablePattern",
                descEn: "naming pattern",
                descCn: "",
                defaultValue: "(_)?[a-z][A-Za-z0-9]*",
            },
            {
                param: "excludeClassPattern",
                descEn: "ignores variables in classes which match this regex",
                descCn: "",
                defaultValue: "$^",
            },
            {
                param: "ignoreOverridden",
                descEn: "ignores member properties that have the override modifier",
                descCn: "",
                defaultValue: true,
            },
        ],
        url: "https://detekt.dev/docs/rules/naming#variablenaming",
    },
];